<?php require_once('../Connections/elevate954.php'); ?>
<?php require_once("../webassist/database_management/wa_appbuilder_php.php"); ?>
<?php require_once( "../webassist/security_assist/helper_php.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Logged in to ADMIN_SETTINGS")){
	WA_Auth_RestrictAccess("../login_admin.php");
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
?>
<?php
$ParamProductID_WADAProducts = "-1";
if (isset($_GET['ProductID'])) {
  $ParamProductID_WADAProducts = $_GET['ProductID'];
}
mysql_select_db($database_elevate954, $elevate954);
$query_WADAProducts = sprintf("SELECT ProductID, ProductSKU, ProductName, ProductPrice, ProductRetailPrice, ProductWeight, ProductShortDesc, ProductLongDesc, ProductThumb, ProductImage, ProductLive, ProductTitle, ProductMetaKeywords, ProductMetaDescription FROM Products WHERE ProductID = %s", GetSQLValueString($ParamProductID_WADAProducts, "int"));
$WADAProducts = mysql_query($query_WADAProducts, $elevate954) or die(mysql_error());
$row_WADAProducts = mysql_fetch_assoc($WADAProducts);
$totalRows_WADAProducts = mysql_num_rows($WADAProducts);
?>
<?php 
// WA Application Builder Delete
if (isset($_POST["Delete"]) || isset($_POST["Delete_x"])) // Trigger
{
  $WA_connection = $elevate954;
  $WA_table = "Products";
  $WA_redirectURL = "products_results.php?ProductID=".((isset($_POST["WADADeleteRecordID"]))?$_POST["WADADeleteRecordID"]:"")  ."";
  if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
  $WA_keepQueryString = false;
  $WA_fieldNamesStr = "ProductID";
  $WA_columnTypesStr = "',none,''";
  $WA_fieldValuesStr = "".((isset($_POST["WADADeleteRecordID"]))?$_POST["WADADeleteRecordID"]:"")  ."";
  $WA_comparisonStr = "=";
  $WA_fieldNames = explode("|", $WA_fieldNamesStr);
  $WA_fieldValues = explode($WA_AB_Split, $WA_fieldValuesStr);
  $WA_columns = explode("|", $WA_columnTypesStr);
  $WA_comparisions = explode("|", $WA_comparisonStr);
  $WA_connectionDB = $database_elevate954;
  mysql_select_db($WA_connectionDB, $WA_connection);
  if (!session_id()) session_start();
  $deleteParamsObj = WA_AB_generateWhereClause($WA_fieldNames, $WA_columns, $WA_fieldValues, $WA_comparisions);
  $WA_Sql = "DELETE FROM `" . $WA_table . "` WHERE " . $deleteParamsObj->sqlWhereClause;
  $MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
  if ($WA_redirectURL != "")  {
    if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
      $WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
    }
    header("Location: ".$WA_redirectURL);
  }
}
?>
<!doctype html>
<html><!-- InstanceBegin template="/Templates/ADMIN BACKEND.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<link rel="stylesheet" type="text/css" href="style/style.css" />
	<link rel="stylesheet" type="text/css" href="style/fluid.css" title="fluid" media="screen" />
        
	<title>Chameleon Circuit | Admin Panel from Themio</title>
        <script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.14.custom.min.js"></script>

        <script type="text/javascript" src="js/excanvas.min.js"></script>
        <script type="text/javascript" src="js/jquery.flot.min.js"></script>
        <script type="text/javascript" src="js/jquery.flot.pie.min.js"></script>
        <script type="text/javascript" src="js/jquery.flot.stack.min.js"></script>

        <script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
        <script type="text/javascript" src="js/jquery.labelify.js"></script>
        <script type="text/javascript" src="js/iphone-style-checkboxes.js"></script>
        <script type="text/javascript" src="js/jquery.ui.selectmenu.js"></script>
        <script type="text/javascript" src="js/vanadium-min.js"></script>
        <script type="text/javascript" src="js/jquery.cleditor.min.js"></script>
        <script type="text/javascript" src="js/superfish.js"></script>
        <script type="text/javascript" src="js/jquery.colorbox-min.js"></script>
        <script type="text/javascript" src="js/styleswitch.js"></script>

        <script type="text/javascript" src="js/fullcalendar.min.js"></script>
        <script type="text/javascript" src="js/jquery.uploadify.v2.1.4.min.js"></script>
        <script type="text/javascript" src="js/uploadify.js"></script>
        <script type="text/javascript" src="js/jquery.tipsy.js"></script>

        <script type="text/javascript" src="js/gcal.js"></script>
        <script type="text/javascript" src="js/swfobject.js"></script>
        <script type="text/javascript" src="js/jquery.pnotify.min.js"></script>
        <script type="text/javascript" src="js/examples.js"></script>

        <script type="text/javascript" src="js/sidemenu.js">// Strictly for sidebar </script>

        <!-- Toolbar for Demo Only -->
        <link rel="stylesheet" type="text/css" href="demo/toolbar.css" />
        <link rel="stylesheet" media="screen" type="text/css" href="demo/colorpicker/css/colorpicker.css" />
        <style type="text/css">
        .bodyarea_admin {
	width: 100%;
	margin: 10px
}
        </style>
        <script type="text/javascript" src="demo/colorpicker/js/colorpicker.js"></script>
        <!-- Demo js Only -->
        <script type="text/javascript" src="js/demo.js"></script>
        <!-- InstanceBeginEditable name="head" -->


<script src="../webassist/progress_bar/jquery-blockui-formprocessing.js" type="text/javascript"></script>

<link href="../webassist/forms/fd_basic_default.css" rel="stylesheet" type="text/css">
<link href="../webassist/forms/dataassist_button.css" rel="stylesheet" type="text/css" />
<style>

/* Details page CSS */
form.DetailsPage {
    width: auto;	
}

.black_overlay{
	display: none;
	position: absolute;
	top: 0%;
	left: 0%;
	width: 100%;
	height: 100%;
	background-color: black;
	z-index:1001;
	-moz-opacity: 0.8;
	opacity:.80;
	filter: alpha(opacity=80);
}
.messageContainer {
	display: none;
	position: absolute;
	top:0;
	width: 100%;
	z-index:1002;
	text-align:center;
	height:100%;
	#position: relative;
	overflow: hidden;
}
.messageWrapper {
	#position: absolute; 
	#top: 50%;
	display: table-cell; 
	vertical-align: middle;	
}
.messageContent {
	background-color:white;
    display: inline-block;
	padding: 16px;
	border: 16px solid grey;
	z-index:1002;
	overflow: auto;
	margin: auto;
	#position: relative; 
	#top: -50%;
}</style>
<!-- InstanceEndEditable -->
</head>


<body>
<?php include("s_header.php"); ?>
    <div class="grid_16 widget first">
        <div class="widget_title clearfix">
            <h2>&nbsp;</h2>
        </div>
        <div class="widget_body">
          <div class="widget_content">
          </div>
            <div class="bodyarea_admin" id="bodyarea_admin"><!-- InstanceBeginEditable name="BODY_AREA" -->
<div id="Details_Basic_Default_ProgressWrapper">
<form class="DetailsPage Basic_Default" id="Details_Basic_Default" name="Details_Basic_Default" method="post" action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>">
        <fieldset class="Basic_Default" id="Details">
          <legend class="groupHeader">Details</legend>
        
<div>
<a name="top"></a>
	<?php if ($totalRows_WADAProducts > 0) { // Show if recordset not empty ?>
	<div id="WADADetails">
			<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0" width="100%">
			<tr>
				<td class="DetailsSublabel">ID:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductID']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">SKU:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductSKU']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Name:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductName']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Price:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductPrice']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Retail Price:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductRetailPrice']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Weight:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductWeight']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Short Description:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductShortDesc']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Long Description:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductLongDesc']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Thumbnail Image:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductThumb']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Full Size Image:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductImage']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Available:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductLive']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Page Title:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductTitle']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Meta-Keywords:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductMetaKeywords']); ?></td>
			</tr>
			<tr>
				<td class="DetailsSublabel">Meta-Description:</td>
				<td class="DetailsPage"><?php echo($row_WADAProducts['ProductMetaDescription']); ?></td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
		</table>
  <hr/>
	</div>
	<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAProducts == 0) { // Show if recordset empty ?>
	<div>
		<div>This record has been removed.</div>
	</div>
	<hr/>
<?php } // Show if recordset empty ?>
</div>
<span class="buttonFieldGroup" >
		<div>
			<table border="0" cellpadding="0" cellspacing="0">
				<tr>
				    <?php if ($totalRows_WADAProducts > 0) { // Show if recordset not empty ?>
				  <td><input type="button" value="Top" class="formButton unstyled" id="Top" name="Top" onclick="window.location.hash='top';" /></td>
					<td><input type="button" value="Update" class="formButton unstyled" id="Update" name="Update" onclick="document.location.href = 'products_update.php?ProductID=<?php echo($row_WADAProducts["ProductID"]); ?>
<?php echo(isset($_GET["pageNum_WADAProducts"])?"&pageNum_WADAProducts=".intval($_GET["pageNum_WADAProducts"]):""); ?>';" /></td>
					<td><input type="button" value="Delete" class="formButton unstyled" id="DeleteConfirm" name="DeleteConfirm" onclick="document.getElementById('deleteBox').style.display = 'block';document.getElementById('deleteMessage').style.display = 'table';"  /></td>
					<?php } // Show if recordset not empty ?>
					
				
					
					<td><input type="button" value="Back To Results" class="formButton unstyled" id="BackToResults" name="BackToResults" onclick="document.location.href = 'products_results.php<?php echo(isset($_GET["pageNum_WADAProducts"])?"?pageNum_WADAProducts=".intval($_GET["pageNum_WADAProducts"]):""); ?>';" /></td>
				   </tr>
			</table>
		</div></span>
        </fieldset>
</form></div><div id="Details_Basic_Default_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
<script type="text/javascript">
WADFP_SetProgressToForm('Details_Basic_Default', 'Details_Basic_Default_ProgressMessageWrapper', WADFP_Theme_Options['BigSpin:Slate']);
</script>
<div id="Details_Basic_Default_ProgressMessage" >
	<p style="margin:10px; padding:5px;" ><img src="../webassist/progress_bar/images/slate-largespin.gif" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;Please wait</p>
</div>
</div>

<div class="black_overlay" id="deleteBox"></div>
<div class="messageContainer" id="deleteMessage">
	<div class="messageWrapper">
	<form class="Basic_Default" method="post" action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>" style="width:auto;">
      <input type="hidden" name="WADADeleteRecordID" id="WADADeleteRecordID" value="<?php echo($row_WADAProducts["ProductID"]); ?>" />
	  <div class="messageContent">
		This will permanently remove the record from your database.<br/>
		This action cannot be undone.<br/><br/>
		<input type="submit" value="Delete" class="formButton unstyled" id="Delete" name="Delete" />
		<input type="button" value="Cancel" class="formButton unstyled" id="Cancel" name="Cancel" onclick="document.getElementById('deleteBox').style.display = 'none';document.getElementById('deleteMessage').style.display = 'none';"  />
	  </div>
	</form>
  </div>
</div>
<!-- InstanceEndEditable --></div>
        </div>
        </div>
    </div>
    <!--
<div id="dialog" title="Hello, Hello, Twisted Transistor">
	<p>Chameleon Circuit features unlimited color schemes. Try moving the color sliders on the top right corner of your screen and see how you would like YOUR theme to be!</p>
</div>
-->
<?php include("footer.php") ?>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($WADAProducts);
?>
